import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/ManageSchool/GetSchoolList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const teacherList = (SchoolId) => {
  return request({
    url: '/api/AppMentalityEvaluating/GetTeacherInfBySchool',
    method: 'get',
    params: {
      SchoolId,
    }
  })
}
export const Schooldetail = (SchoolId) => {
  return request({
    url: '/api/AppMentalityEvaluating/GetSchoolConfigInfo',
    method: 'get',
    params: {
      SchoolId,
    }
  })
}
export const SchoolAdd = (data) => {
  return request({
    url: '/api/AppMentalityEvaluating/AddSchoolConfig',
    method: 'post',
    data,
  })
}
export const getDetail = (id) => {
  return request({
    // url: '/api/school-service/school/detail',
    url: '/api/ManageSchool/GetSchoolInfo',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (params) => {
  return request({
    url: '/api/ManageSchool/DelSchool',
    method: 'post',
    data:params
    // params: {
    //   ids,
    // }
  })
}

export const add = (row) => {
  return request({
    // url: '/api/school-service/school/submit',
    url: '/api/ManageSchool/EditSchool',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    // url: '/api/school-service/school/submit',
    url: '/api/ManageSchool/EditSchool',
    method: 'post',
    data: row
  })
}

// 获取权限设置树
export const grantTree = (params) => {
  return request({
    url: '/api/ManageSchool/GetAppMenuList',
    method: 'get',
    params: params
  })
}

// 获取权限设置默认选中id
export const getRole = (params) => {
  return request({
    url: '/api/ManageSchool/GetSchoolAppMenuList',
    method: 'get',
    params: params
  })
}

export const grant = (params) => {
  return request({
    url: '/api/ManageSchool/AddOrEditSchoolAppMenu',
    method: 'post',
    data: params
  })
}

// 获取板块配置树
export const getPlateDataList = (params) => {
  return request({
    url: '/api/ManageSchool/GetPlateDataList',
    method: 'get',
    params: params
  })
}
//获取学校拥有的板块集合
export const getSchoolPlateDataList = (params) => {
  return request({
    url: '/api/ManageSchool/GetSchoolPlateDataList',
    method: 'get',
    params: params
  })
}
// 获取学校拥有的板块集合
export const addOrEditSchoolPlate = (params) => {
  return request({
    url: '/api/ManageSchool/AddOrEditSchoolPlate',
    method: 'post',
    data: params
  })
}
//获取问卷模板列表
export const getQuestTempList = (params) => {
  return request({
    url: '/api/ManageSchool/GetQuestTempList',
    method: 'get',
    params: params
  })
}
//获取学校拥有的问卷模板(默认选中的数据)
export const getSchoolQuestTempList = (params) => {
  return request({
    url: '/api/ManageSchool/GetSchoolQuestTempList',
    method: 'get',
    params: params
  })
}
// 添加或修改学校的问卷模板
export const addOrEditSchoolQuestTemp = (params) => {
  return request({
    url: '/api/ManageSchool/AddOrEditSchoolQuestTemp',
    method: 'post',
    data: params
  })
}





